home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1226_changing_bundle_extension.rtf < prev    next >
Text File  |  1995-06-12  |  2KB  |  69 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fmodern Courier;\f2\fmodern Ohlfs;}
  2. \paperw12240
  3. \paperh10300
  4. \margl120
  5. \margr120
  6. {\colortbl;\red0\green0\blue0;\red81\green81\blue81;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc1\cf1 Q:  I'm building a bundle project, but I want the bundle to have a different extension than the default .bundle so I can treat it as a document for my own application or for an application like Preferences or BackSpace.\
  8. \
  9. A:  When bundles were originally released it was thought that they would only be used to dynamically load infrequently used parts of an application.  However, it's now very common and even encouraged to make your application extensible by having it accept bundle documents at runtime.  Applications like Preferences, BackSpace and IconBuilder all do this. Since these bundles are essentially unique file formats (you wouldn't, for instance, try to load a BackSpace module into Preferences) they need unique extensions.\
  10. \
  11. In Release 3.0 and 3.1 you can change the extension of a bundle from its default of .bundle by adding the following lines to the Makefile.preamble and Makefile.postamble respectively:\
  12. \
  13.  
  14. \b Addition to Makefile.preamble
  15. \b0 \
  16. \
  17. Add the following to Makefile.preamble to set a new extension and install directory (replace 
  18. \b XXXX
  19. \b0  with the new extension and 
  20. \b AppName
  21. \b0  with your application's name):\
  22. \
  23.  
  24. \f3\fs24     BUNDLE_EXT = .
  25. \b XXXX
  26. \b0 \
  27.     INSTALLDIR = $(HOME)/Library/
  28. \b AppName
  29. \b0 \
  30.     OTHER_PRODUCT_DEPENDS = $(NAME)$(BUNDLE_EXT)\
  31.     OTHER_GARBAGE = $(NAME)$(BUNDLE_EXT)\
  32.  
  33. \f0\fs28 \
  34.  
  35. \b Addition to Makefile.postamble
  36. \b0 \
  37. \
  38. Add the following to Makefile.postamble to build the bundle with the new extension:\
  39. \
  40. Remove the old version of the named bundle before installation:\
  41. \
  42.  
  43. \f3\fs24     before_install::\
  44.         rm -rf $(DSTROOT)$(INSTALLDIR)/$(NAME)$(BUNDLE_EXT)\
  45.  
  46. \f0\fs28 \
  47. Move the bundle to its new extension after installation:\
  48. \
  49.  
  50. \f3\fs24     after_install::\
  51.         mv $(DSTROOT)$(INSTALLDIR)/$(NAME).bundle    \\\
  52.             $(DSTROOT)$(INSTALLDIR)/$(NAME)$(BUNDLE_EXT)\
  53.  
  54. \f0\fs28 \
  55. Link the bundle to its new extension for incremental building/testing:\
  56. \
  57.  
  58. \f3\fs24     $(NAME)$(BUNDLE_EXT):\
  59.         -ln -s  $(NAME).bundle $(NAME)$(BUNDLE_EXT)\
  60.  
  61. \f0\fs28 \
  62. In Release 3.2 this problem will be fixed by the addition of the BUNDLE_EXTENSION macro. You can simply set this macro in the Makefile.preamble to get the new extension.\
  63. \
  64. QA888\
  65. \
  66. Valid for 3.0, 3.1\
  67. \
  68.  
  69.